home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / IFC_112 / netscape / application / FontItem.java < prev    next >
Encoding:
Text File  |  1999-05-28  |  1.1 KB  |  60 lines  |  [TEXT/CWIE]

  1. // FontItem.java
  2. // By Ned Etcode
  3. // Copyright 1996, 1997 Netscape Communications Corp.  All rights reserved.
  4.  
  5. package netscape.application;
  6.  
  7. import netscape.util.*;
  8.  
  9.  
  10. class FontItem extends PopupItem {
  11.     String      fontName;
  12.     int         tag;
  13.  
  14.  
  15. /* constructors */
  16.  
  17.     /** Constructs a FontItem. */
  18.     FontItem() {
  19.         super();
  20.     }
  21.  
  22.  
  23.  
  24. /* actions */
  25.  
  26.     /** Sets the name of the Font that this FontItem represents. */
  27.     public void setFontName(String aName) {
  28.         fontName = aName;
  29.     }
  30.  
  31.     /** Returns the name of the Font that this FontItem represents.
  32.       * @see #setFontName
  33.       */
  34.     public String fontName() {
  35.         return fontName;
  36.     }
  37.  
  38.     /** Returns <b>true</b> if the FontItem's font name matches <b>aName</b>.
  39.       */
  40.     public boolean hasFontName(String aName) {
  41.         if (aName == null) {
  42.             return false;
  43.         }
  44.  
  45.         return aName.equals(fontName);
  46.     }
  47.  
  48.     /** Sets the FontItem's tag. */
  49.     public void setTag(int tag) {
  50.         this.tag = tag;
  51.     }
  52.  
  53.     /** Returns the FontItem's tag.
  54.       * @see #setTag
  55.       */
  56.     public int tag() {
  57.         return tag;
  58.     }
  59. }
  60.